﻿<Page x:Class="SoftTeach.View.Noten.MetroSelectSchülerlistePage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:datenbank="clr-namespace:SoftTeach.ViewModel.Datenbank"
      xmlns:datenbankView="clr-namespace:SoftTeach.View.Datenbank"
      xmlns:softTeach="clr-namespace:SoftTeach"
      xmlns:personen="clr-namespace:SoftTeach.ViewModel.Personen"
      mc:Ignorable="d" 
      d:DesignHeight="768" 
      d:DesignWidth="1366"
      Title="Auswahl"
      FontSize="20">
  <Page.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/SoftTeach;component/Resources/MetroResources.xaml"/>
        <ResourceDictionary >
          <DataTemplate DataType="{x:Type datenbank:JahrtypViewModel}" x:Key="SchuljahrDataTemplate">
            <datenbankView:MetroSchuljahrDetailView />
          </DataTemplate>
          <DataTemplate DataType="{x:Type datenbank:HalbjahrtypViewModel}" x:Key="HalbjahrDataTemplate">
            <datenbankView:MetroHalbjahrDetailView />
          </DataTemplate>
          <DataTemplate DataType="{x:Type datenbank:FachViewModel}" x:Key="FächerDataTemplate">
            <datenbankView:MetroFachDetailView />
          </DataTemplate>
          <DataTemplate DataType="{x:Type personen:SchülerlisteViewModel}" x:Key="SchülerlisteDataTemplate">
            <datenbankView:MetroSchülerlisteDetailView />
          </DataTemplate>
        </ResourceDictionary>
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </Page.Resources>
  <Grid  Stylus.IsPressAndHoldEnabled="False">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="200"/>
      <ColumnDefinition/>
      <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" Background="{StaticResource MetroHeaderBackground}">
      <Label Foreground="White" HorizontalAlignment="Center">Lerngruppe auswählen</Label>
    </Border>
    <ListBox Grid.Row="1" Grid.Column="0"
                 ItemsSource="{Binding Source={x:Static softTeach:App.MainViewModel}, Path=Jahrtypen}"             
                 BorderThickness="0"
                 Name="SchuljahrListBox"
                 ItemTemplate="{StaticResource SchuljahrDataTemplate}"
                 ItemContainerStyle="{StaticResource MetroSilentListBoxItem}">
      <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
          <WrapPanel Width="{Binding ElementName=SchuljahrListBox, Path=ActualWidth, Converter={StaticResource WrapPanelWidthConverter}}" Orientation="Horizontal"/>
        </ItemsPanelTemplate>
      </ListBox.ItemsPanel>
    </ListBox>
    <ListBox Grid.Row="1" Grid.Column="1"
                 ItemsSource="{Binding Source={x:Static softTeach:App.MainViewModel}, Path=Fächer}"             
                 BorderThickness="0"
                 Name="FächerListBox"
                 ItemTemplate="{StaticResource FächerDataTemplate}"
                 ItemContainerStyle="{StaticResource MetroSilentListBoxItem}">
      <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
          <WrapPanel Width="{Binding ElementName=FächerListBox, Path=ActualWidth}" Orientation="Horizontal"/>
        </ItemsPanelTemplate>
      </ListBox.ItemsPanel>
    </ListBox>
    <ListBox Grid.Row="1" Grid.Column="2"
                 ItemsSource="{Binding Source={x:Static softTeach:App.MainViewModel}, Path=SchülerlisteWorkspace.SchülerlistenView}"             
                 BorderThickness="0"
                 Name="SchülerlistenListBox"
                 ItemTemplate="{StaticResource SchülerlisteDataTemplate}"
                 ItemContainerStyle="{StaticResource MetroSilentListBoxItem}">
      <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
          <WrapPanel Width="{Binding ElementName=SchülerlistenListBox, Path=ActualWidth}" Orientation="Horizontal"/>
        </ItemsPanelTemplate>
      </ListBox.ItemsPanel>
    </ListBox>
  </Grid>
</Page>
